"use strict";
/**
 * 数字枚举 - 有反向映射
 * Up使用初始化为 1。 其余的成员会从 1开始自动增长
 * Up没有初始值时，默认为 0
 */
// 全部都会转换
var Direction;
(function (Direction) {
    Direction[Direction["Up"] = 1] = "Up";
    Direction[Direction["Down"] = 2] = "Down";
    Direction[Direction["Left"] = 3] = "Left";
    Direction[Direction["Right"] = 4] = "Right";
})(Direction || (Direction = {}));
console.log(Direction.Up);
/**
 * 字符串枚举
 */
var Direction2;
(function (Direction2) {
    Direction2["Up"] = "up";
    Direction2["Down"] = "down";
    Direction2["Left"] = "left";
    Direction2["Right"] = "right";
})(Direction2 || (Direction2 = {}));
console.log(Direction2.Up);
console.log(1 /* Direction3.Up */);
// function walk(str: Direction) {
//   if (str === Direction.Up) {
//     console.log("往【上】走")
//   } else if (str === Direction.Down) {
//     console.log("往【下】走")
//   } else if (str === Direction.Left) {
//     console.log("往【左】走")
//   } else if (str === Direction.Right) {
//     console.log("往【右】走")
//   }
// }
// walk(Direction.Up)
